/* eslint-disable quotes */
// eslint-disable-next-line no-unused-vars
const Mock = require('mockjs')
// const Random = Mock.Random

const departmentRes = {
  code: '200',
  subCode: '200',
  message: '请求成功',
  success: true,
  data: [
    {
      id: '1',
      parentId: '0',
      weight: 0,
      name: '天翼安全公司',
      createTime: '2022-01-14 15:51:42',
      children: [
        {
          id: '2',
          parentId: '1',
          weight: 0,
          name: '行政中心',
          createTime: '2022-01-14 15:51:42'
        },
        {
          id: '3',
          parentId: '1',
          weight: 0,
          name: '技术中心',
          createTime: '2022-01-14 15:51:42',
          children: [
            {
              id: '5',
              parentId: '3',
              weight: 0,
              name: '研发中心',
              createTime: '2022-01-14 15:51:42',
              children: [
                {
                  id: '1491971557247471617',
                  parentId: '5',
                  weight: 1,
                  name: '安全大脑',
                  createTime: '2022-02-11 11:05:13'
                }
              ]
            },
            {
              id: '6',
              parentId: '3',
              weight: 0,
              name: '产品中心',
              createTime: '2022-01-14 15:51:42'
            },
            {
              id: '7',
              parentId: '3',
              weight: 0,
              name: '测试中心',
              createTime: '2022-01-14 15:51:42'
            },
            {
              id: '1491680844307812354',
              parentId: '3',
              weight: 1,
              name: '测试中心-1',
              createTime: '2022-02-10 15:50:02'
            }
          ]
        },
        {
          id: '4',
          parentId: '1',
          weight: 0,
          name: '运营中心',
          createTime: '2022-01-14 15:51:42'
        }
      ]
    }
  ]
}
const loginConfig = {
  code: '200',
  subCode: '200',
  message: '请求成功',
  success: true,
  data: {
    appName: '',
    loginTypes: ['USERNAME', 'TEL'],
    imageAuth: {
      enable: true
    },
    verifyCode: {
      enable: true,
      verifyTypeList: [
        { value: 'sms', label: '微信' },
        { value: 'wechat', label: '企业微信' }
      ]
    }
  }
}

module.exports = [
  // 获取登录配置
  {
    url: '/auth/auth/login',
    type: 'post',
    response: (config) => {
      return {
        code: '200',
        subCode: 'C100005',
        message: '用户名或密码错误！',
        success: false,
        data: { token: 'token', tokenHead: 'authentication' }
      }
    }
  },
  // 退出登录接口
  {
    url: '/local/auth/auth/logout',
    type: 'post',
    response: (config) => {
      return {
        code: '200',
        subCode: 'C100005',
        message: '用户名或密码错误！',
        success: false,
        data: { token: 'token', tokenHead: 'authentication' }
      }
    }
  },
  // 获取登录配置
  {
    url: '/auth/auth/config',
    type: 'get',
    response: (config) => {
      return loginConfig
    }
  },
  // 获取用户详情
  {
    url: '/admin/user/info',
    type: 'get',
    response: (config) => {
      return {
        code: '200',
        subCode: '200',
        message: '请求成功',
        success: true,
        data: {
          roles: [],
          permissions: [],
          sysUser: { username: 'Test', avatar: '' }
        }
      }
    }
  },
  {
    url: '/getpassword/user',
    type: 'get',
    response: (config) => {
      return {
        code: '200',
        subCode: '200',
        message: '请求成功',
        success: true,
        data: {
          regulateId: '1',
          regulateName: '默认配置',
          defaultStatus: true,
          description:
            '2密码长度为8-20\n不允许包含空格\n连续字符不能超过3个\n键盘连续按键不能超过3个\n至少包含2个大写字母\n至少包含2个小写字母\n至少包含2个数字\n至少包含2个特殊字符[@$!%*#_~?&^].'
        }
      }
    }
  },
  {
    url: '/local/admin/regulation/checklogin',
    type: 'get',
    response: (config) => {
      return {
        code: '200',
        data: { mustModify: false, enableRemind: false, remainingDays: 3 },
        message: '',
        subCode: 'C010004',
        success: false
      }
    }
  },
  {
    url: '/local/admin/menu',
    type: 'get',
    response: (config) => {
      return {
        code: '200',
        data: 'null',
        message: '',
        subCode: 'C010004',
        success: false
      }
    }
  },
  {
    url: '/admin/dept/tree',
    type: 'get',
    response: (config) => {
      return departmentRes
    }
  }
]
